var express = require('express');
var router = express.Router();
var userServices = require("../services/usersServices");


/* GET home page. */
router.get('/', function(req, res, next) {
	res.render('index', { title: 'Express' });
});

//登陆操作
router.post('/login', function(req, res, next) {
	//用户验证
	var username = req.body.username;
	var password = req.body.password;

	userServices.checkLogin(username,password,function(data){

		console.log(data.result.users);
		res.render("./users/user_index",{user:data});
	})
	
	

});


module.exports = router;
